﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Helper;
using System.Data;
namespace CoreData
{
   public partial class VwStudentFee
    {
       public long ID { set; get; } //StudentID
       public string Name { get; set; }
       public string ClassName { get; set; }
       public string CourseName { get; set; }
       public string BranchName { get; set; }
       public int ClassType { get; set; }
       public int TypeOfFee { get; set; }
       public DateTime StartDate1 { get; set; }
       public DateTime StartDate2 { get; set; }
       public DateTime StartDate3 { get; set; }
       public DateTime StartDate4 { get; set; }
       public DateTime StartDate5 { get; set; }
       public DateTime StartDate6 { get; set; }
       public DateTime EndDate1 { get; set; }
       public DateTime EndDate2 { get; set; }
       public DateTime EndDate3 { get; set; }
       public DateTime EndDate4 { get; set; }
       public DateTime EndDate5 { get; set; }
       public DateTime EndDate6 { get; set; }

       //phải đóng
       public long MoneyPay { get; set; }
       public long Money1 { get; set; }
       public long Money2 { get; set; }
       public long Money3 { get; set; }
       public long Money4 { get; set; }
       public long Money5 { get; set; }
       public long Money6 { get; set; }

       //da đóng
       public long MoneyPaid { get; set; }
   

       //còn nợ
       public long MoneyNotPaid { get; set; }

       public DateTime StartDate { get; set; }
       public DateTime EndDate { get; set; }
       public DateTime DateOfReserved { get; set; }
       public DateTime DateOfOff { get; set; }
       public DateTime DateOfCompleted { get; set; }
       public int StudentStatus { get; set; }

       public VwStudentFee() { }

       static VwStudentFee DynamicCast<T>(object row_data, object row_header) where T : VwStudentFee
       {
           // row_data : DataRow
           // row_header : DataColumnCollection
           VwStudentFee ret = new VwStudentFee();
           DataRow dt = (DataRow)row_data;

           foreach (DataColumn column in (DataColumnCollection)row_header)
           {
               switch (column.ColumnName)
               {
                   case "ID":
                       ret.ID = ConvertObject.ToLong(dt[column]);
                       break;
                   case "Name":
                       ret.Name = ConvertObject.ToString(dt[column]);
                       break;
                   case "ClassName":
                       ret.ClassName = ConvertObject.ToString(dt[column]);
                       break;
                   case "CourseName":
                       ret.CourseName = ConvertObject.ToString(dt[column]);
                       break;
                   case "BranchName":
                       ret.BranchName = ConvertObject.ToString(dt[column]);
                       break;
                   case "ClassType":
                       ret.ClassType = ConvertObject.ToInt(dt[column]);
                       break;
                   case "TypeOfFee":
                       ret.TypeOfFee = ConvertObject.ToInt(dt[column]);
                       break;
                   case "StartDate1":
                       ret.StartDate1 = ConvertObject.ToDateTime(dt[column]);
                       break;
                   case "StartDate2":
                       ret.StartDate2 = ConvertObject.ToDateTime(dt[column]);
                       break;

                   case "StartDate3":
                       ret.StartDate3 = ConvertObject.ToDateTime(dt[column]);
                       break;

                   case "StartDate4":
                       ret.StartDate4 = ConvertObject.ToDateTime(dt[column]);
                       break;

                   case "StartDate5":
                       ret.StartDate5 = ConvertObject.ToDateTime(dt[column]);
                       break;

                   case "StartDate6":
                       ret.StartDate6 = ConvertObject.ToDateTime(dt[column]);
                       break;
                   case "EndDate1":
                       ret.EndDate1 = ConvertObject.ToDateTime(dt[column]);
                       break;
                   case "EndDate2":
                       ret.EndDate2 = ConvertObject.ToDateTime(dt[column]);
                       break;
                   case "EndDate3":
                       ret.EndDate3 = ConvertObject.ToDateTime(dt[column]);
                       break;
                   case "EndDate4":
                       ret.EndDate4 = ConvertObject.ToDateTime(dt[column]);
                       break;
                   case "EndDate5":
                       ret.EndDate5 = ConvertObject.ToDateTime(dt[column]);
                       break;
                   case "EndDate6":
                       ret.EndDate6 = ConvertObject.ToDateTime(dt[column]);
                       break;
                   case "Money1":
                       ret.Money1 = ConvertObject.ToLong(dt[column]);
                       break;
                   case "Money2":
                       ret.Money2 = ConvertObject.ToLong(dt[column]);
                       break;
                   case "Money3":
                       ret.Money3 = ConvertObject.ToLong(dt[column]);
                       break;
                   case "Money4":
                       ret.Money4 = ConvertObject.ToLong(dt[column]);
                       break;
                   case "Money5":
                       ret.Money5 = ConvertObject.ToLong(dt[column]);
                       break;
                   case "Money6":
                       ret.Money6 = ConvertObject.ToLong(dt[column]);
                       break;
                   case "DateOfReserved":
                       ret.DateOfReserved = ConvertObject.ToDateTime(dt[column]);
                       break;
                   case "DateOfOff":
                       ret.DateOfOff = ConvertObject.ToDateTime(dt[column]);
                       break;
                   case "DateOfCompleted":
                       ret.DateOfCompleted = ConvertObject.ToDateTime(dt[column]);
                       break;
                   case "StudentStatus":
                       ret.StudentStatus = ConvertObject.ToInt(dt[column]);
                       

                       break;

               }

           }

           return ret;
       }


    }
}
